package com.eascs.spider.hr.common.controller;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.common.assertion.exception.WarnAssertionException;
import com.eascs.site.view.BaseRestResult;

public abstract class AbstractBaseViewController extends com.eascs.site.controller.BaseViewController {
	private final Logger logger = LoggerFactory.getLogger(AbstractBaseViewController.class);

	@ExceptionHandler
	@ResponseBody
	@Override
	public Object exception(WarnAssertionException sssertionException) {
		logger.info(sssertionException.getMessage(), sssertionException);
		return BaseRestResult.warn(sssertionException.getMessage());
	}
}